﻿namespace Example
{
    using StoryQ;

    using Xunit;

    public sealed class TallyFacts
    {
        private Tally Tally { get; set; }

        [Fact]
        public void a_new_tally()
        {
            new Story("Tally")
                .Tag("unit")
                .InOrderTo("keep a running count")
                .AsA("tally keeper")
                .IWant("to start from scratch")
                .WithScenario("a new tally")
                .Given(ANewTally)
                .When(IIncrement)
                .Then(TheTallyValueShouldBe, 1)
                .Execute();
        }

        private void ANewTally()
        {
            Tally = new Tally();
        }

        private void IIncrement()
        {
            Tally.Increment();
        }

        private void TheTallyValueShouldBe(int expected)
        {
            var actual = Tally.Value;

            Assert.Equal(expected, actual);
        }
    }
}